home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 3
/
Cream of the Crop 3.iso
/
comm
/
wnos5src.zip
/
PKVEC.ASM
< prev
next >
Wrap
Assembly Source File
|
1993-08-09
|
2KB
|
93 lines
; Packet driver interrupt hooks
.MODEL MEMMOD,C
%MACS
extrn pkint:proc
.DATA
extrn Stktop
.CODE
sssave dw ?
spsave dw ?
axsave dw ?
dbase dw @data
; pkvec0 - Packet driver receive call handler #0
public pkvec0
label pkvec0 far
pushf ; save his interrupt state
cli ; no distractions
mov cs:sssave,ss ; stash user stack context
mov cs:spsave,sp
mov cs:axsave,ax ; save our AX register
mov ss,cs:dbase ; set up interrupt stack
lea sp,Stktop
push ds ; save for caller
mov ax,ss
mov ds,ax
mov ax,0 ; device #0
push ax
mov ax,cs:axsave ; Restore AX
pushf ; make it look like an INTERRUPT
call pkint
jmp pkret
; pkvec1 - Packet driver receive call handler #1
public pkvec1
label pkvec1 far
pushf ; save his interrupt state
cli ; no distractions
mov cs:sssave,ss ; stash user stack context
mov cs:spsave,sp
mov cs:axsave,ax ; save our AX register
mov ss,cs:dbase ; set up interrupt stack
lea sp,Stktop
push ds ; save for caller
mov ax,ss
mov ds,ax
mov ax,1 ; device #1
push ax
mov ax,cs:axsave ; Restore AX
pushf ; make it look like an INTERRUPT
call pkint
jmp pkret
; pkvec2 - Packet driver receive call handler #2
public pkvec2
label pkvec2 far
pushf ; save his interrupt state
cli ; no distractions
mov cs:sssave,ss ; stash user stack context
mov cs:spsave,sp
mov cs:axsave,ax ; save our AX register
mov ss,cs:dbase ; set up interrupt stack
lea sp,Stktop
push ds ; save for caller
mov ax,ss
mov ds,ax
mov ax,2 ; device #2
push ax
mov ax,cs:axsave ; Restore AX
pushf ; make it look like an INTERRUPT
call pkint
jmp pkret
; common return for all packet drivers
label pkret near
pop ax ; pop dev # arg
pop ds ; restore for caller
mov ss,cs:sssave
mov sp,cs:spsave ; restore original stack context
popf
retf
end